<?php include('header.php'); ?>

<?php
include("/usr/local/apache2/htdocs/jibaiwang/lib/CorpInfo.php");
include('log4php/Logger.php');
$cfgfile = "/usr/local/apache2/htdocs/jibaiwang/admin/conf/config.ini";
$defarray = parse_ini_file($cfgfile, 1);
$qlogtag = $defarray["CorpInfo"]['qlogtag'];
Logger::configure($defarray["CorpInfo"]['qlogcfg']);
$logger = Logger::getLogger($qlogtag);
$host = $defarray["CorpInfo"]["host"];
$user = $defarray["CorpInfo"]["user"];
$pass = $defarray["CorpInfo"]["pass"];
$db = $defarray["CorpInfo"]["db"];
$dbh = new Sqlexecutor($host, $user, $pass, $db);
$s = new CorpInfo($dbh,$logger);
if($_REQUEST["submit"] == "1")
{
    $subject1 = $_REQUEST["subject1"];
    $subject2 = $_REQUEST["subject2"];
    $subject3 = $_REQUEST["subject3"];
    $subject4 = $_REQUEST["subject4"];
    $subject5 = $_REQUEST["subject5"];
    $subject6 = $_REQUEST["subject6"];
    $subject7 = $_REQUEST["subject7"];
    $res = $s->update($subject1, $subject2, $subject3,$subject4,$subject5,$subject6,$subject7);
    header("Location:CorpInfo.php");
}
$list = $s->getInfo();
$txt1 = $list["txt1"];
$txt2 = $list["txt2"];
$txt3 = $list["txt3"];
$txt4 = $list["txt4"];
$txt5 = $list["txt5"];
$txt6 = $list["txt6"];
$txt7 = $list["txt7"];

?>
			<div>
				<ul class="breadcrumb">
					<li>
						<a href="#">系统管理</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="#">公司信息管理</a>
					</li>
				</ul>
			</div>
	
			<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-edit"></i> 公司信息管理</h2>
<!--
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
						</div>
-->
					</div>
					<div class="box-content">
						<form class="form-horizontal">
							<fieldset>
							  <div class="control-group">
								<div class="controls">
                                <input class="input-large focused span5" name="subject1" id="subject1" type="text" value="<?php echo $txt1;?>">
								</div>
							  </div>
							  <div class="control-group">
								<div class="controls">
                                <input class="input-large focused span5" name="subject2" id="subject2" type="text" value="<?php echo $txt2;?>">
								</div>
							  </div>
                              <div class="control-group">
								<div class="controls">
                                <input class="input-large focused span5" name="subject3" id="subject3" type="text" value="<?php echo $txt3;?>">
								</div>
							  </div>
                              <div class="control-group">
								<div class="controls">
                                <input class="input-large focused span5" name="subject4" id="subject4" type="text" value="<?php echo $txt4;?>">
								</div>
							  </div>
                              <div class="control-group">
								<div class="controls">
                                <input class="input-large focused span5" name="subject5" id="subject5" type="text" value="<?php echo $txt5;?>">
								</div>
							  </div>
                              <div class="control-group">
								<div class="controls">
                                <input class="input-large focused span5" name="subject6" id="subject6" type="text" value="<?php echo $txt6;?>">
								</div>
							  </div>
                              <div class="control-group">
								<div class="controls">
                                <input class="input-large focused span5" name="subject7" id="subject7" type="text" value="<?php echo $txt7;?>">
								</div>
							  </div>





                              <div class="form-actions">
								<button value="1" name="submit" type="submit" class="btn btn-primary">保存修改</button>
								<button class="btn">取消修改</button>
							  </div>
							</fieldset>
						  </form>
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
		   
<?php include('footer.php'); ?>
